package cn.vivi.design.command;

import java.util.Map;

public class OrderCommand implements Command{

    private Chef chef;
    private Order order;

    public OrderCommand(Chef chef, Order order) {
        this.chef = chef;
        this.order = order;
    }

    @Override
    public void execute() {
        System.out.println(order.getDiningTable() + " 桌的订单");
        Map<String, Integer> foodDir = order.getFoodDir();
        for (String name : foodDir.keySet()) {
            chef.makeFood(name, foodDir.get(name));
        }
    }
}
